﻿using Furion.DependencyInjection;
using Furion.FriendlyException;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ECO.Admin.Core.Attribute
{
    public class ExceptionAttribute : ExceptionFilterAttribute
    {
        /// <summary>
        /// 异常拦截器
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override Task OnExceptionAsync(ExceptionContext context)
        {
            Console.WriteLine(context.Exception.Message);
            Console.WriteLine(context.Exception.StackTrace);
            // 代码参考接口方式
            return base.OnExceptionAsync(context);
        }
    }
}
